package com.gxa.meiye.portal.service.zy.impl;

import com.gxa.meiye.core.utils.RestUtils;
import com.gxa.meiye.portal.service.zy.LogOutService;

import org.springframework.stereotype.Service;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;

import java.util.Map;

/**
 * @Author: zy
 * @CreateTime: 2022-07-25  15:14
 */
@Service
public class LogOutServiceImpl implements LogOutService {
    @Override
    public boolean del(String phone) {
        String url="http://1.117.60.194:8082/consumer/logout";
        MultiValueMap<String,Object> params=new LinkedMultiValueMap<>();
        params.add("phone",phone);
        RestUtils restUtils=new RestUtils();
        Map map = restUtils.postWithParams(url, params);
        Object code = map.get("code");
        if (code.toString().equals("1")){
            return true;
        }
        return false;
    }
}
